package com.sky.common.framework.dto.req;

import com.alibaba.fastjson.annotation.JSONField;

public class RequestHeader {

	private String userId;

	private String requestId;

	private String token;
	// 0 老师 1学生
	private int userType;
	// 名称
	private String name;

	public RequestHeader() {
	}

	public RequestHeader(String userId) {
		super();
		this.userId = userId;
	}

	public RequestHeader(String userId, String requestId) {
		super();
		this.userId = userId;
		this.requestId = requestId;
	}

	public RequestHeader(String userId, String requestId, String token) {
		super();
		this.userId = userId;
		this.requestId = requestId;
		this.token = token;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getRequestId() {
		return requestId;
	}

	public void setRequestId(String requestId) {
		this.requestId = requestId;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public int getUserType() {
		return userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}

	@JSONField(deserialize = false, serialize = false)
	public Integer getUserIdInteger() {

		return userId == null ? null : Integer.parseInt(userId);
	}

	@JSONField(deserialize = false, serialize = false)
	public Long getUserIdLong() {

		return userId == null ? null : Long.parseLong(userId);
	}

}
